<?php
require_once 'phiction/loader.php';
use \modules\org\storage as org;
use \modules\user\storage as user;
use \modules\contact\storage as contact;
use \modules\potential\storage as potential;

$ld = new \phiction\schema_loader;
$ld->scan();

$pdo = database::get()->connect();

$migrate = new \phiction\migrate($ld);
$migrate->run($pdo);

$q = new \phiction\query_builder($ld, $pdo);

org::add($q, "code", "")->run();        // 1
org::add($q, "daylong", "")->run();     // 2
org::edit($q, 1, "码坑股份有限公司", "近期本公司股价大涨，快抢购")->run();
org::edit($q, 2, "戴笼集团", "")->run();

user::add($q, "0001", "1234", "admin"   , "亚德民", "平吞万顷苍茫，吐耀霓虹，剑雄万敌。惊奇自胸中，叹人狂天地空", 1)->run();
user::add($q, "0001", "1234", "admin"   , "哈达姆", "乱世失序，乾坤蒙祸。云中怒啸，清荡天道", 2)->run();
user::add($q, "0003", "1234", "salesman", "小李", "", 1)->run();
user::add($q, "0004", "1234", "salesman", "小张", "收到发射的方式", 1)->run();
user::add($q, "0005", "1234", "salesman", "小欣", "娃儿个回复收到", 1)->run();
user::add($q, "0002", "1234", "salesman", "小徐", "上帝给复活节", 2)->run();
user::add($q, "0007", "1234", "salesman", "小赵", "散发阿凡额", 1)->run();
user::add($q, "0008", "1234", "salesman", "小慧", "f回房间敢回家可", 1)->run();
user::add($q, "0009", "1234", "salesman", "小白", "士大夫天眼", 1)->run();
user::add($q, "0010", "1234", "salesman", "老徐", "沙发上打法", 1)->run();
user::add($q, "0011", "1234", "salesman", "老赵", "", 1)->run();
user::add($q, "0012", "1234", "salesman", "老慧", "", 1)->run();
user::add($q, "0013", "1234", "salesman", "老白", "", 1)->run();
user::add($q, "0014", "1234", "salesman", "大李", "如画风光，有你在歌唱", 1)->run();
user::add($q, "0015", "1234", "salesman", "大张", "平生不喜笼中鸟，我图娱悦彼在牢。何情何理屈物性，一羽一毫皆天造。体天万物托命乎，好风相润渡魔考", 1)->run();
user::add($q, "0016", "1234", "salesman", "大欣", "且向山水寻光景，何必江湖争令名？竹杖芒鞋轻胜马，天地苍茫任吾行", 1)->run();
user::add($q, "0017", "1234", "salesman", "大徐", "话九宸，挥袖风云尽，江山何沉？随逸兴，负手乾坤定，苍黄为轻", 1)->run();
user::add($q, "0018", "1234", "salesman", "大赵", "一叶风筝忽上升，轻浮竟遇好风乘。任它高入青云路，牵引无非仗宝绳", 1)->run();
user::add($q, "0002", "1234", "salesman", "大慧", "荒郊无路认南北，江湖水深总长东。青山相澹虑已浅，无如归去待鸣筝", 1)->run();

contact::add($q , "沽命师"     , "man"   , "annabelle91@example.net"       , "18664840001" , "上海体育馆学习中心：上海市徐汇区凯旋路3500号华苑大厦2号楼15层C座（地铁1号线7号出口）" , ""        , "七宝学习中心：闵行区七莘路3655号4层05C"                                     , new \DateTime("1997-3-12" ) , "残酷无情、藐视生命，深具商人本色"                                                                                                                                                       , 1)->run();
contact::add($q , "巧天工"     , "woman" , "cassandre87@example.org"       , "18664840002" , "上中路学习中心：上海市徐汇区上中路285号"                                              , ""        , ""                                                                           , new \DateTime("2000-9-20" ) , "临水吟，木蓉寂开落无人，问红萼，有美不自蔽，安能守孤根？阅尽江湖不染尘，光华点滴缀剑心，唯斯人。"                                                                                       , 1)->run();
contact::add($q , "雨霖铃"     , "woman" , "conn.daniela@example.org"      , "18664840003" , "田林路学习中心：上海市徐汇区桂林路396号2楼"                                           , ""        , ""                                                                           , new \DateTime("2000-4-3"  ) , "一拂长袖胜雪，疏风淡月，青埂山下暗尘绝，炼顽石，补天缺。"                                                                                                                               , 1)->run();
contact::add($q , "应无骞"     , "woman" , "cruz87@example.com"            , "18664840004" , "人民广场学习中心：上海市黄浦区新闸路211号（地铁1号线5号出口）"                        , ""        , ""                                                                           , new \DateTime("1996-5-28" ) , "一生算计，死到临头仍欲以巧智谋生，又怎料得，聪明反被聪明误。朗朗青云，功，也难留；名，也难留"                                                                                           , 1)->run();
contact::add($q , "玄真君"     , "man"   , "freedrb@126.com"               , "18664840005" , "虹口足球场学习中心：上海市虹口区东江湾路188号（空间188）D座2楼（靠近虹口足球场）"     , "5244714" , ""                                                                           , new \DateTime("1993-4-21" ) , "人生有酒须当醉，一滴何曾到九泉。"                                                                                                                                                       , 1)->run();
contact::add($q , "玉佛一捧雪" , "man"   , "kenny84@example.net"           , "18664840006" , "和平公园学习中心：上海市虹口区大连路1053号卢比克魔方1楼（和平公园东侧）"              , "6467716" , ""                                                                           , new \DateTime("1992-12-20") , "早却凡情付梵行，错心只得愧倾城，世间安有双全法，不负如来不负卿"                                                                                                                         , 1)->run();
contact::add($q , "却尘思"     , "man"   , "kpouros@example.net"           , "18664840007" , "四川北路学习中心：上海市虹口区四川北路1318号盛邦国际大厦3楼（肯德基旁边进）"          , "7172951" , "周浦学习中心：上海市浦东新区周浦镇年家浜路445号2楼"                         , new \DateTime("1992-5-15" ) , "死之苦来生之趣，恨之深来爱之惧。人世荣辱总轮回，负仇千载一朝遇。"                                                                                                                       , 1)->run();
contact::add($q , "夕华沉"     , "man"   , "macy.shanaha@example.net"      , "18664840008" , "陆家嘴学习中心：上海市浦东新区商城路303号申金大厦裙楼2层A座（菊园小学对面）"          , "9763493" , ""                                                                           , new \DateTime("1990-8-28" ) , "是非场里出入逍遥，顺逆境中纵横自在"                                                                                                                                                     , 1)->run();
contact::add($q , "梦不觉"     , "woman" , "mcglynn.bonita@example.net"    , "18664840009" , "金桥学习中心：上海市浦东新区博山东路560弄2号105室"                                    , ""        , ""                                                                           , new \DateTime("1994-10-9" ) , "山城大梦莫如深，迷身入幻数浮沉。珠玑点落三山盟，梦觉何究是非真"                                                                                                                         , 1)->run();
contact::add($q , "別见黄花落" , "man"   , "okoepp@example.com"            , "18664840010" , "耀华路学习中心：上海市浦东新区耀华路488号信建大厦7楼"                                 , ""        , ""                                                                           , new \DateTime("1993-10-20") , "别后漫天飞花转，人舞一剑探花殇，天涯有记梦魂穿，别见黄花落秋凉。"                                                                                                                       , 1)->run();
contact::add($q , "楚遗"       , "woman" , "renner.mariam@example.com"     , "18664840011" , "周浦学习中心：上海市浦东新区周浦镇年家浜路445号2楼"                                   , ""        , ""                                                                           , new \DateTime("1997-5-24" ) , "弓弧名家副席，理性斯文，条理分明、性格严谨，在弓弧名家中扮演负责打点大小事的角色。性格中有傲气，然而隐藏得很好，不会轻易端架子"                                                         , 1)->run();
contact::add($q , "忧百骸"     , "man"   , "rick63@example.org"            , "18664840012" , "高桥学习中心：上海市浦东新区清溪路320号"                                              , "5973017" , "彭浦新村学习中心：上海市闸北区江场西路160号美邦大楼1楼（大润发超市正对面）" , new \DateTime("1995-12-19") , "性格阴森恐怖，手持唤魂铃，藉此控制僵尸"                                                                                                                                                 , 1)->run();
contact::add($q , "风之痕"     , "man"   , "schultz.raphael@example.org"   , "18664840013" , "羽山路学习中心：上海市浦东新区羽山路666号"                                            , "6634588" , "惠南镇学习中心：上海市浦东新区城南路168弄1号"                               , new \DateTime("1996-6-28" ) , "昂首千丘远，啸傲风间；堪寻敌手共论剑，高处不胜寒"                                                                                                                                       , 1)->run();
contact::add($q , "乱世狂刀"   , "woman" , "seamus70@example.org"          , "18664840014" , "惠南镇学习中心：上海市浦东新区城南路168弄1号"                                         , "3009972" , ""                                                                           , new \DateTime("1996-4-3"  ) , "一箫一剑平生意，负尽狂名十五年。箫中弦音藏柔情，剑下腥血寄恨仇；来何汹涌须挥剑，去向缠绵可付箫"                                                                                         , 1)->run();
contact::add($q , "碎无泪"     , "man"   , "shields.mohammad@example.com"  , "18664840015" , "联洋花木学习中心：浦东新区花木路902号"                                                , ""        , ""                                                                           , new \DateTime("1991-3-9"  ) , "血铃碎梦残，刀出人不还"                                                                                                                                                                 , 1)->run();
contact::add($q , "永恒茧"     , "man"   , "tvonrueden@example.com"        , "18664840016" , "川沙学习中心：浦东新区川沙路4825号现代广场6楼"                                        , ""        , ""                                                                           , new \DateTime("1992-11-21") , "永鉴审判诸邪罪定，永恒真理诸使当听。永夜咒火败秽焚净，永昼圣日降世长明"                                                                                                                 , 1)->run();
contact::add($q , "司空灵羽"   , "woman" , "valentin12@example.com"        , "18664840017" , "五角场学习中心：上海市杨浦区四平路2158号富庆国定大厦12层（四平路国定路出口）"         , ""        , ""                                                                           , new \DateTime("1995-10-10") , "云掩雾藏高名，闲来征曲倾耳听。龙虎风云会一时，骄子江山入弦中"                                                                                                                           , 1)->run();
contact::add($q , "永恒诗"     , "man"   , "vbogan@example.org"            , "18664840018" , "杨浦学习中心：上海市杨浦区永吉路9号"                                                  , ""        , ""                                                                           , new \DateTime("1991-10-18") , "九轮降世失败后，九轮天毁灭，带领九轮天子民迁徙怪贩妖市，之后协助苦境正道一起对抗幽都"                                                                                                   , 1)->run();
contact::add($q , "赮毕钵罗"   , "woman" , "vickie97@example.net"          , "18664840019" , "中山公园学习中心：上海市长宁区长宁路350号日旭商务中心2楼（近江苏北路交叉口）"         , ""        , "联洋花木学习中心：浦东新区花木路902号"                                      , new \DateTime("1994-6-9"  ) , "幸福，是痛苦的变形，如同沙漠中的一滴水，在入口瞬间便消失，无法解渴，却是更让人感到缺水的痛苦，刹那的甘甜，对比出苦难的永恒；行走，只是不想在原地等待，但寻求的本质，却让心在原地打转。" , 1)->run();
contact::add($q , "深海主宰"   , "man"   , "wilderman.sabrina@example.com" , "18664840020" , "娄山关路学习中心：上海市天山路989号虹桥天都2号口2楼"                                  , ""        , ""                                                                           , new \DateTime("2000-5-11" ) , "青山一发谁在握？当时初望，尔今千载。蚁裳披来重登临，紫陌封尘雪已深。"                                                                                                                   , 1)->run();
contact::add($q , "麒麟星"     , "man"   , "zoe.wintheiser@example.com"    , "18664840021" , "虹桥镇学习中心：上海市闵行区吴中路1068号燎申大厦6层F座（苏宁电器正对面）"             , "8075743" , ""                                                                           , new \DateTime("1993-9-22" ) , "天海·麒麟星，魔吞十二宫的麒麟宫代表，亦是魔吞不动城之城主，脸戴麒麟面具，身披紫色战服，为人自信、冷静、擅于谋计，更对当今武林局势有着高度了解，乃魔吞不动城的领导与统筹者"              , 1)->run();
contact::add($q , "纵横子"     , "woman" , "1175708593@qq.com"             , "18664840022" , "七宝学习中心：闵行区七莘路3655号4层05C"                                               , "3021450" , ""                                                                           , new \DateTime("1994-3-8"  ) , "仙人有待乘黄鹤，海客无心随白鸥，抟扶摇，看青霄，黑白有道，壮气赋云潮"                                                                                                                   , 1)->run();
contact::add($q , "唐绝"       , "woman" , "asfdwer@163.com"               , "18664840023" , "彭浦新村学习中心：上海市闸北区江场西路160号美邦大楼1楼（大润发超市正对面）"           , "9312657" , ""                                                                           , new \DateTime("1998-6-14" ) , "一马疾平川、双蝶利翦风、三蛟乱穿云、五丁怒开山、九龙极崩世、黑日分天"                                                                                                                   , 1)->run();
contact::add($q , "teemo"      , "woman" , "asf2432@126.com"               , "18664840024" , "淞虹路学习中心：上海市长宁区剑河路530号"                                              , "2636235" , ""                                                                           , new \DateTime("1993-10-12") , "百载春光一舟轻，且饮且歌行，笑拥婵娟，醉邀天星，红楼听雨声"                                                                                                                             , 1)->run();

potential::add($q, "卖纸尿布"   , 1  , new \DateTime("2016-05-21") , "那边有个需要纸尿布的" , 1 , 3 , 3 )->run();
potential::add($q, "卖铅笔"     , 2  , new \DateTime("2016-05-13") , "你要卖铅笔码"         , 1 , 3 , 4 )->run();
potential::add($q, "卖饮料"     , 3  , new \DateTime("2016-01-23") , "康师傅的"             , 1 , 6 , 5 )->run();
potential::add($q, "iphone"     , 4  , new \DateTime("2016-03-18") , "需要买吗"             , 1 , 6 , 6 )->run();
potential::add($q, "macbook"    , -5 , new \DateTime("2016-05-02") , "我没钱"               , 1 , 6 , 7 )->run();
potential::add($q, "卖流量"     , 2  , new \DateTime("2016-04-11") , "我一个月剩好多"       , 1 , 2 , 8 )->run();
potential::add($q, "卖快餐"     , 2  , new \DateTime("2016-04-04") , "难吃死"               , 1 , 2 , 3 )->run();
potential::add($q, "衣服"       , 1  , new \DateTime("2016-05-25") , "夏季的"               , 1 , 3 , 4 )->run();
potential::add($q, "鞋子"       , -2 , new \DateTime("2016-02-05") , "真皮的"               , 1 , 3 , 5 )->run();
potential::add($q, "充电宝"     , 3  , new \DateTime("2016-04-01") , "安全、可控"           , 1 , 3 , 6 )->run();
potential::add($q, "麦片"       , 4  , new \DateTime("2016-05-02") , "好吃不上火"           , 1 , 4 , 7 )->run();
potential::add($q, "冲q币"      , 5  , new \DateTime("2016-04-06") , "打折的"               , 1 , 4 , 8 )->run();
potential::add($q, "风扇"       , 6  , new \DateTime("2016-02-03") , "你爱要不要"           , 1 , 4 , 9 )->run();
potential::add($q, "二手笔记本" , 7  , new \DateTime("2016-03-10") , "我不需要"             , 1 , 4 , 10)->run();
potential::add($q, "拖鞋"       , 8  , new \DateTime("2016-01-20") , "来一双"               , 1 , 4 , 3 )->run();
potential::add($q, "域名"       , -9 , new \DateTime("2016-03-02") , "订制的"               , 1 , 6 , 4 )->run();
potential::add($q, "感冒药"     , 10 , new \DateTime("2016-04-17") , "效果好"               , 1 , 5 , 5 )->run();
potential::add($q, "百度会员"   , 11 , new \DateTime("2016-01-06") , "贵死了"               , 1 , 5 , 6 )->run();
potential::add($q, "咖啡"       , 12 , new \DateTime("2016-05-01") , "纯咖啡"               , 1 , 5 , 7 )->run();
potential::add($q, "奶茶"       , 13 , new \DateTime("2016-02-09") , "经典奶茶"             , 1 , 7 , 8 )->run();
potential::add($q, "苹果"       , 14 , new \DateTime("2016-03-14") , "旺季的"               , 1 , 7 , 9 )->run();
potential::add($q, "香蕉"       , 15 , new \DateTime("2016-04-10") , "快要卖完了"           , 1 , 7 , 10)->run();

